#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main (int argc, char const* argv[])
{
    int a, b, i, n;
    char c[2];

    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%s", c);
        scanf("%d %d", &a, &b);

        if (c[0] == '+') {
            printf("%d\n", a + b);
        } else if (c[0] == '-') {
            printf("%d\n", a - b);
        } else if (c[0] == '*') {
            printf("%d\n", a * b);
        } else if (a/b*b == a) {
            printf("%d\n", a / b);
        } else {
            printf("%.2f\n", (double)a / b);
        }
    }

    return 0;
}
